package com.code.base.state.service;

import java.util.List;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.code.base.state.persistence.StateCheckMapper;
import com.code.base.state.pojo.StateCheck;
import com.code.util.PrimaryKeyUtil;


@Service
public class StateCheckService {


	@Resource
	private StateCheckMapper stateCheckMapper;

	public Long getInsertId() {
		return PrimaryKeyUtil.generatePrimaryKey();
	}

	public StateCheck getDataById(Long id) {
		return stateCheckMapper.getDataById(id);
	}

	public List<StateCheck> getAllData() {
		return stateCheckMapper.getAllData();
	}

	public int getDataCountByCondition(StateCheck entity) {
		return stateCheckMapper.getDataCountByCondition(entity);
	}

	public List<StateCheck> getDataByCondition(StateCheck entity) {
		return stateCheckMapper.getDataByCondition(entity);
	}

	public int getDataCountByLikeCondition(StateCheck entity) {
		return stateCheckMapper.getDataCountByLikeCondition(entity);
	}

	public List<StateCheck> getDataByLikeCondition(StateCheck entity) {
		return stateCheckMapper.getDataByLikeCondition(entity);
	}

	public List<StateCheck> getDataByIds(Long[] ids) {
		return stateCheckMapper.getDataByIds(ids);
	}

	public void insertData(StateCheck entity) {
		insertData(entity, true);
	}

	public void insertData(StateCheck entity, boolean setIdValue) {
		if (setIdValue) {
			entity.setId(getInsertId());
		}
		stateCheckMapper.insertData(entity);
	}

	public void updateData(StateCheck entity) {
		stateCheckMapper.updateData(entity);
	}

	public void updateDataByParam(Map<String, Object> map) {
		if (map.size() == 0)
			return;

		stateCheckMapper.updateDataByParam(map);
	}

	public void deleteDataByObject(StateCheck entity) {
		stateCheckMapper.deleteDataByObject(entity);
	}

	public void deleteDataById(Long id) {
		stateCheckMapper.deleteDataById(id);
	}

	public void deleteDataByIds(Long[] ids) {
		stateCheckMapper.deleteDataByIds(ids);
	}

}
